//
//  JLYOtherTools.m
//  Zuisuigirveup
//
//  Created by spdbmacbook0003 on 2025/8/5.
//

#import "JLYOtherTools.h"
#import <YYText/YYText.h>
@implementation JLYOtherTools
+(NSAttributedString *)JLYGetAttrsudaWithjsTextt:(NSString *)text{
    if([NSString JZLIsNilString:text])return nil;
    NSMutableParagraphStyle * jlystrye = [[NSMutableParagraphStyle alloc] init];
    [jlystrye setLineSpacing:2];
    jlystrye.lineBreakMode = NSLineBreakByWordWrapping;
    jlystrye.alignment = NSTextAlignmentLeft;
    NSMutableAttributedString *mustsjad = [[NSMutableAttributedString alloc]initWithString:text];
    [mustsjad addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0, text.length)];
    [mustsjad addAttribute:NSParagraphStyleAttributeName value:jlystrye range:NSMakeRange(0, text.length)];
    return mustsjad;
    
}
+(CGSize)JLYGetTiplabelsconawith:(NSAttributedString *)attl{
    YYTextLayout *layout = [YYTextLayout layoutWithContainerSize:CGSizeMake(JLYScreenWidth-JLYTap*2, CGFLOAT_MAX) text:attl];
    return layout.textBoundingSize;
}
+(YYImage *)JLYGetImageWithName:(NSString *)img{
    NSString *path =  [[NSBundle mainBundle] pathForResource:@"imgsources" ofType:@"bundle"];
    NSString *imnfilesand = [path stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.webp",img]];
    YYImage *imh = [YYImage imageWithContentsOfFile:imnfilesand];
    return imh;
}
@end
